/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package exemple;

import address.AddressIp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Set;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author PC
 */
@Entity
@Table(name="HISTORIC_SYSTEM")
@XmlRootElement(name="HistoricSystem")
public class HistoricSystem implements java.io.Serializable {
    private static final long serialVersionUID = -8667337896773261247L;
 
    private int id_historic;
    private String date_historic;
    private AddressIp address;
    private double cpuUse;
    private double memFree;
    private Set<ProcessusB> listProcess;

    public HistoricSystem() {
    }

    public HistoricSystem(int id_historic, String date_historic, double cpuUse, double memFree) {
        this.id_historic = id_historic;
        this.date_historic = date_historic;
        this.cpuUse = cpuUse;
        this.memFree = memFree;
    }
     
 
    @Id
    @GeneratedValue
    @Column(name="ID_HISTORIC")
    public int getId_historic() {
        return id_historic;
    }
    
    @Column(name="DATE_HISTORIC")
    public String getDate_historic() {
        return date_historic;
    }   
 
    @Column(name="CPU_USE")
    public double getCpuUse() {
        return cpuUse;
    }
  
     @Column(name="MEM_FREE")
    public double getMemFree() {
        return memFree;
    }
    

    public void setId_historic(int id_historic) {
        this.id_historic = id_historic;
    }  

    public void setDate_historic(String date_historic) {
        this.date_historic = date_historic;
    }

    public void setCpuUse(double cpuUse) {
        this.cpuUse = cpuUse;
    }
    
    public void setMemFree(double memFree) {
        this.memFree = memFree;
    }
    
    @ManyToOne
    @JoinColumn(name="id_address")
    public AddressIp getAddress() {
        return address;
    }

    public void setAddress(AddressIp address) {
        this.address = address;
    } 
    
    @OneToMany(mappedBy="historicSystem")
    public Set<ProcessusB> getListProcess() {
        return listProcess;
    }

    public void setListProcess(Set<ProcessusB> listProcess) {
        this.listProcess = listProcess;
    }  

    @Override
    public String toString() {
        return "HistoricSystem{" + "id_historic=" + id_historic + ", date_historic=" + date_historic + ", address=" + address + ", cpuUse=" + cpuUse + ", memFree=" + memFree + '}';
    }
}
